]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspaceThumbnail: Enable activation of window clones on touch
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 16 Oct 2015 16:12:45 +0000 (18:12 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Fri, 4 Dec 2015 10:50:13 +0000 (11:50 +0100)
We must handle the TOUCH_END event separately for the evdev input
backend.

https://bugzilla.gnome.org/show_bug.cgi?id=756748

js/ui/workspaceThumbnail.js

index df8bc55633d355401b6657736dd8324574f4fcb2..3b650ba29aee88cd0d12da371256b790f54bd3f1 100644 (file)
@@ -80,6 +80,8 @@ const WindowClone = new Lang.Class({
 
         this.actor.connect('button-release-event',
                            Lang.bind(this, this._onButtonRelease));
+        this.actor.connect('touch-event',
+                           Lang.bind(this, this._onTouchEvent));
 
         this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
 
@@ -200,6 +202,15 @@ const WindowClone = new Lang.Class({
         return Clutter.EVENT_STOP;
     },
 
+    _onTouchEvent : function (actor, event) {
+        if (event.type() != Clutter.EventType.TOUCH_END ||
+            !global.display.is_pointer_emulating_sequence(event.get_event_sequence()))
+            return Clutter.EVENT_PROPAGATE;
+
+        this.emit('selected', event.get_time());
+        return Clutter.EVENT_STOP;
+    },
+
     _onDragBegin : function (draggable, time) {
         this.inDrag = true;
         this.emit('drag-begin');